Skip to content

Conversation

@Krishna-web-hub
Copy link
Contributor

@Krishna-web-hub Krishna-web-hub commented Oct 25, 2025

gh-84116: Doc: update the argparse documentation to clearly define the help and aliases parameters for add_parser() and added the required news file for this change.

Doc/library/argparse.rst

Replaced the vague, single-sentence description of _SubParsersAction.add_parser with a formal .. method:: directive.

This new directive explicitly lists help and aliases as parameters, along with descriptions of what they do.

Removed the old, redundant paragraphs about help (which was in parentheses) and aliases (which was a "Furthermore..." note) from later in the document. This centralizes all the information in one logical place.

Misc/NEWS.d/next/Library/...

Added the required "blurb" file to log this documentation fix.


📚 Documentation preview 📚: https://cpython-previews--140574.org.readthedocs.build/

@StanFromIreland StanFromIreland changed the title Doc fix 84116Docs: Document help and aliases for argparse.add_parser() (gh-84116) #84116 gh-84116: Docs: Document help and aliases for argparse.add_parser() Oct 25, 2025
Copy link
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seem to be two different things mixed in this PR, please split it.

@picnixz
Copy link
Member

picnixz commented Jan 2, 2026

Before continuing working on this PR, please fix the conflicts.

@Krishna-web-hub
Copy link
Contributor Author

Hi @picnixz ,
Thanks for your valuable feedback. But the changes in the Sub-commands and sub-parser are told by the @savannahostrowski, mentioning #142488 , and also the anto was my mistake while doing some changes in the doc.

@picnixz
Copy link
Member

picnixz commented Jan 2, 2026

If some changes were mentioned in another PR, please merge main into this branch. You need to do it because there are conflicts. And those conflicts must be resolved before merging:

image

Once the diff is clean maybe some changes will be correct. But we are still lacking some description that are now gone and that must not be changed.

@Krishna-web-hub
Copy link
Contributor Author

Hi @picnixz , @savannahostrowski I have done the requested change please review it again.

@Krishna-web-hub
Copy link
Contributor Author

@picnixz , @savannahostrowski i want to know what i will be doing for the Sub-command please enlighten me such that i can do the final changes.

@picnixz
Copy link
Member

picnixz commented Jan 13, 2026

Keep your changes for that.

Comment on lines 1889 to 1890
.. method:: _SubParsersAction.add_parser(name, *, help=None, aliases=None,
deprecated=False, **kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to aligned deprecated with name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Krishna-web-hub
Copy link
Contributor Author

image Hello @picnixz , do you want it like this or something else. Please confirm me so that i can work in that direction.

@Krishna-web-hub
Copy link
Contributor Author

Please @picnixz , give me final instruction to fix this documentation issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

5 participants